'use strict';
module.exports = app => {
  const { STRING, BOOLEAN, CHAR, INTEGER, DATE } = app.Sequelize; // 获取数据类型
  const UserAdmin = app.modelmysql.define(
    'useradmin',
    {
      id: { type: CHAR(27), primaryKey: true },
      username: { type: STRING },
      password: { type: STRING },
      nickname: { type: STRING },
      is_super: { type: BOOLEAN },
      tid: { type: CHAR(27) },
      img: { type: STRING },
      state: { type: BOOLEAN },
      is_company: { type: BOOLEAN },
      companyname: { type: STRING },
      email: { type: STRING },
      companyURL: { type: STRING },
      telephone: { type: STRING },
      address: { type: STRING },
      users: { type: INTEGER },
      years: { type: INTEGER },
      code: { type: STRING },
      authorizedstarttime: { type: DATE },
      language: { type: STRING },
      outsidestaff: { type: BOOLEAN },
    }
  );
  UserAdmin.associate = function() {
    app.modelmysql.UserAdmin.belongsTo(app.modelmysql.TenantAdmin);
  };
  return UserAdmin;
};
